const fs = require('fs');

function getFileByPath(fpath) {
    var promise = new Promise(function (resolve, reject) {
        fs.readFile(fpath, 'utf-8', (err, dataStr) => {
            if (err) return reject(err)
            resolve(dataStr)
        })
    })
    return promise
}

getFileByPath('./dist/1.txt')
    .then(function (data) {
        console.log(data + '❤');
        return getFileByPath('./dist/2.txt')

    })
    .then(function (data) {
        console.log(data + '❤❤');
        return getFileByPath('./dist/3.txt')

    })
    .then(function (data) {
        console.log(data + '❤❤❤')
    })